package com.example.consumer.receiver;

import com.example.consumer.config.RabbitConfig;
import com.example.consumer.config.TopicConfig;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;

@Component
public class TopicReceiver {
    @RabbitListener(queues = TopicConfig.HUAWEI_QUEUE)
    public static void huaweiMessage1(Message message, Channel channel){
        System.out.println("huawei message= "+message.getPayload());
    }
    @RabbitListener(queues = TopicConfig.IPHONE_QUEUE)
    public static void iphoneMessage2(Message message, Channel channel){
        System.out.println("iphone message = "+message.getPayload());
    }
    @RabbitListener(queues = TopicConfig.XIAOMI_QUEUE)
    public static void xiaomiMessage2(Message message, Channel channel){
        System.out.println("xiaomi message = "+message.getPayload());
    }

}
